# -*- coding: utf-8 -*-
"""
Created on Thu Sep  6 15:08:01 2012

@author: xudi
"""

import numpy as np
import pylab as pl
sampling_rate = 4e10
fft_size =4000
tw=2.25e-10
t0=3*tw
t = np.arange(0.,1e-8,1.0/sampling_rate)
ft=np.exp(-(t-t0)**2/tw**2)
x=ft[:fft_size]
xf1=np.fft.fft(x,fft_size)
xf2=np.abs(np.fft.fftshift(xf1))
freqs=np.linspace(0,sampling_rate,fft_size)-sampling_rate/2
pl.figure(figsize=(8,6))
pl.subplot(211)
pl.plot(t[:fft_size],x)
pl.subplot(212)
pl.plot(freqs,xf2)
pl.show()
# test svn